package zrweb;

import java.sql.*;

public class ConnDB 
{
	private Connection connection = null;
	
	public Connection getConn()
	{
		try
		{
			Class.forName("org.postgresql.Driver").newInstance();
			String url = "jdbc:postgresql://localhost:5432/postgres" ;
			connection = DriverManager.getConnection(url, "postgres" , "aa123456" );
			//connection = DriverManager.getConnection(url, "postgres" , "postgres" );
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		finally
		{
		}
		return connection;
	}
	
	public static void releaseConnection( Connection c)
	{
		if(c != null)
		{
			try
			{
				c.close();
			}
			catch (SQLException e)
			{
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}